<template>
  <div class="app-container">
    <el-card class="card-form">
      <div class="expert-title-outBox">
        <div class="expert-title">方案申报</div>
        <div class="back-btn" @click="handBack">
          <img src="@/assets/images/tripartite/back_button.png" alt="" />返回
        </div>
      </div>
      <el-form
        ref="queryParams"
        :model="queryParams"
        :rules="rules"
        label-width="108px"
        label-position="right"
      >
        <!-- 方案信息 -->
        <div>
          <div class="model-title">
            <img src="../../../assets/images/tripartite/icon_title.png" />
            <span>方案信息</span>
          </div>
          <el-row :gutter="20">
            <el-col :span="8">
              <el-form-item label="项目投资估算" prop="projectInvestmentEstimation">
                <el-input
                  v-model="queryParams.projectInvestmentEstimation"
                  placeholder="请输入"
                  clearable
                  size="medium"
                  maxlength="14"
                >
                </el-input>
                <div class="unit">万元</div>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="项目代码" prop="projectCode" label-width="100px">
                <el-input
                  v-model="queryParams.projectCode"
                  placeholder="请输入"
                  clearable
                  size="medium"
                  maxlength="32"
                >
                </el-input>
              </el-form-item>
            </el-col> 
             <el-col :span="8">
              <el-form-item label="可研批复或立项文件" prop="budgetProposal.fileName" label-width="148px">
                <el-upload
                  ref="upload1"
                  class="upload-demo"
                  :action="upload.url"
                  accept=".doc, .docx, .zip, .rar, .7z"
                  :headers="upload.headers"
                  :limit="1"
                  :on-progress="handleFileUploadProgressOne"
                  :on-success="handleFileSuccessOne"
                >
                  <el-input
                    v-model="queryParams.budgetProposal.fileName"
                    placeholder="请选择文件"
                  />
                  <div class="img_box">
                    <img
                      src="@/assets/images/tripartite/icon_files_upload.png"
                      alt=""
                    />
                  </div>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="8">  
              <el-form-item label="初设方案(可研代初设)" prop="preliminaryDesignScheme.fileName" label-width="158px">
                <el-upload
                  ref="upload3"
                  class="upload-demo"
                  :action="upload.url"
                  accept=".doc, .docx, .zip, .rar, .7z"
                  :headers="upload.headers"
                  :limit="1"
                  :on-progress="handleFileUploadThree"
                  :on-success="handleFileThree"
                >
                  <el-input
                    v-model="queryParams.preliminaryDesignScheme.fileName"
                    placeholder="请选择文件"
                    clearable
                  />
                  <div class="img_box">
                    <img
                      src="@/assets/images/tripartite/icon_files_upload.png"
                      alt=""
                    />
                  </div>
                </el-upload>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="8">
              <el-form-item
                label="云资源需求清单"
                prop="cloudResourceApplication"
                label-width="112px"
              >
                <el-upload
                  ref="upload5"
                  class="upload-demo"
                  :action="upload.url"
                  accept=".xls, .xlsx, .zip, .rar, .7z"
                  :headers="upload.headers"
                  :limit="1"
                  :on-progress="handleFileUploadFive"
                  :on-success="handleFileFive"
                >
                  <el-input
                    v-model="queryParams.cloudResourceApplication.fileName"
                    placeholder="请选择文件"
                  />
                  <div class="img_box">
                    <img
                      src="@/assets/images/tripartite/icon_files_upload.png"
                      alt=""
                    />
                  </div>
                </el-upload>
              </el-form-item>
            </el-col> -->
            <el-col :span="8">
              <el-form-item label="设计单位" prop="designUnit">
                <el-input
                  v-model="queryParams.designUnit"
                  placeholder="请输入"
                  clearable
                  size="medium"
                  maxlength="20"
                >
                </el-input>
              </el-form-item>
            </el-col> 
            <!-- <el-col :span="8">
              <el-form-item label="预算方案" prop="budgetProgramme.fileName">
                <el-upload
                  ref="upload4"
                  class="upload-demo"
                  :action="upload.url"
                  accept=".doc, .docx, .zip, .rar, .7z"
                  :headers="upload.headers"
                  :limit="1"
                  :on-progress="handleFileUploadFour"
                  :on-success="handleFileFour"
                >
                  <el-input
                    v-model="queryParams.budgetProgramme.fileName"
                    placeholder="请选择文件"
                    clearable
                  />
                  <div class="img_box">
                    <img
                      src="@/assets/images/tripartite/icon_files_upload.png"
                      alt=""
                    />
                  </div>
                </el-upload>
              </el-form-item>
            </el-col> -->
            <el-col :span="8">
              <el-form-item label="评标方法" prop="assessmentMethod" label-width="148px">
                <el-select
                  v-model="queryParams.assessmentMethod"
                  placeholder="请选择"
                  clearable
                  size="medium"
                  style="width: 100%"
                >
                  <el-option
                    v-for="dict in assessmentMethodOptions"
                    :key="dict.dictValue"
                    :label="dict.dictLabel"
                    :value="dict.dictValue"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row> 
          <el-row :gutter="20">            
            <el-col :span="8">
              <el-form-item label="其他评标方法" prop="otherMethod" v-if="queryParams.assessmentMethod === '其他'">
                <el-input
                  v-model="queryParams.otherMethod"
                  placeholder="请输入"
                  clearable
                  size="medium"
                  maxlength="10"
                >
                </el-input>
              </el-form-item>
            </el-col>  
            <!-- <el-col :span="8">
              <el-form-item
                label="可行性研究报告"
                prop="researchReport.fileName"
                label-width="140px"
              >
                <el-upload
                  ref="upload2"
                  class="upload-demo"
                  :action="upload.url"
                  accept=".doc, .docx, .zip, .rar, .7z"
                  :headers="upload.headers"
                  :limit="1"
                  :on-progress="handleFileUploadTwo"
                  :on-success="handleFileTwo"
                >
                  <el-input
                    v-model="queryParams.researchReport.fileName"
                    placeholder="请选择文件"
                  />
                  <div class="img_box">
                    <img
                      src="@/assets/images/tripartite/icon_files_upload.png"
                      alt=""
                    />
                  </div>
                </el-upload>
              </el-form-item>
            </el-col> -->
          </el-row>
          <!-- 系统架构简述 -->
          <el-row class="form-textarea">
            <el-form-item
              label="系统架构简述"
              prop="systemArchitecture"
            >
              <el-input
                v-model="queryParams.systemArchitecture"
                placeholder="请输入系统总体架构和逻辑结构"
                clearable
                type="textarea"
                show-word-limit
                maxlength="200"
                size="medium"
                :rows="4"
              />
            </el-form-item>
          </el-row>
        </div>
        <!-- 系统信息 -->
        <div>
          <div class="model-title">
            <img src="@/assets/images/tripartite/icon_title.png" />
            <span>系统信息</span>
          </div>
          <el-button
            type="primary"
            icon="el-icon-plus"
            size="medium"
            @click="handleAddSystem"
            >新增系统信息</el-button
          >
          <el-table
            v-loading="loading"
            :data="systemInfoList"
            border
            class="table_technical"
          >
            <el-table-column
              label="系统名称"
              align="center"
              width="400"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{ scope.row.systemName }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.systemName"
                  placeholder="请输入"
                  maxlength="30"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column label="系统描述" align="center" prop="passingTime">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{ scope.row.systemDesc }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.systemDesc"
                  placeholder="请输入"
                  maxlength="200"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              width="300"
            >
              <template slot-scope="scope">
                <el-button
                  v-show="!scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleEdit(scope.row)"
                  >编辑</el-button
                >
                <el-button
                  v-show="scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleSure(scope.row)"
                  >确定</el-button
                >
                <el-button
                  size="mini"
                  type="text"
                  @click.native.prevent="
                    deleteRow(scope.$index, systemInfoList)
                  "
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 政务数据资源目录清单 -->
        <div>
          <div class="model-title other-title">
            <img src="@/assets/images/tripartite/icon_title.png" />
            <span>政务数据资源目录清单</span>
          </div>
          <el-row :gutter="10" class="mb8">
            <!-- <el-col :span="1.5">
              <el-button
                type="primary"
                icon="el-icon-plus"
                size="medium"
                @click="handleAddGovernment"
                >新增政务清单</el-button
              >
            </el-col> -->
            <el-col :span="1.5">
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="medium"
                @click="handleAddImport"
                >批量导入</el-button
              >
            </el-col>
            <el-col :span="1.5">
              <el-button
                type="text"
                icon="el-icon-download"
                size="medium"
                @click="downloadFile"
                >
                下载清单模版
              <!-- <a href="http://cqaivm.860001.xyz:12241/yzq-approve/附件2.渝中区政务数据资源目录清单模板V1.2.xlsx" target="_blank" download="downloadFileName" class="demo-download">下载清单模版</a>                -->
                </el-button
              >
            </el-col>
            
          </el-row>
          <el-row>上传文件 ：XXX系统政务数据资源目录清单. xls</el-row>
          <el-table
            v-loading="loading"
            :data="governmentDataResourcesAddDtoList"
            border
            class="table_technical"
          >
            <el-table-column
              label="信息资源名称"
              align="center"
              :show-overflow-tooltip="true"
              width="228"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.informationResourceName
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.informationResourceName"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="信息资源来源系统"
              align="center"
              prop="informationResourceSourceSystem"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.informationResourceSourceSystem
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.informationResourceSourceSystem"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="信息资源源代码"
              align="center"
              prop="informationResourceCode"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.informationResourceCode
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.informationResourceCode"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="信息资源提供方"
              align="center"
              prop="informationResourceProvider"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.informationResourceProvider
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.informationResourceProvider"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="提供方内部部门"
              align="center"
              prop="providersInternalDepartment"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.providersInternalDepartment
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.providersInternalDepartment"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="资源提供方代码"
              align="center"
              prop="resourceProviderCode"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.resourceProviderCode
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.resourceProviderCode"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
             <el-table-column
              label="信息资源摘要"
              align="center"
              prop="summaryOfInformationResources"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.summaryOfInformationResources
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.summaryOfInformationResources"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
             <el-table-column
              label="信息资源格式分类"
              align="center"
              prop="classificationOfInformationResourceFormats"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.classificationOfInformationResourceFormats
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.classificationOfInformationResourceFormats"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="信息资源格式类型"
              align="center"
              prop="informationResourceFormatType"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.informationResourceFormatType
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.informationResourceFormatType"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="其他类型资源格式描述"
              align="center"
              prop="other"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.other
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.other"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
             <el-table-column
              label="信息项名称"
              align="center"
              prop="informationItemName"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.informationItemName
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.informationItemName"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="数据类型"
              align="center"
              prop="typeOfData"
              width="228"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.typeOfData
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.typeOfData"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="数据长度"
              align="center"
              prop="dataLength"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.dataLength
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.dataLength"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="共享类型"
              align="center"
              prop="shareType"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.shareType
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.shareType"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="共享条件"
              align="center"
              prop="sharingConditions"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.sharingConditions
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.sharingConditions"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label=" 共享方式分类"
              align="center"
              prop="sharingModeClassification"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.sharingModeClassification
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.sharingModeClassification"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label=" 共享方式类型"
              align="center"
              prop="sharingModeType"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.sharingModeType
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.sharingModeType"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label=" 是否向社会开放"
              align="center"
              prop="isOpen"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.isOpen
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.isOpen"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
             <el-table-column
              label=" 开放条件"
              align="center"
              prop="openConditions"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.openConditions
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.openConditions"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
             <el-table-column
              label=" 更新周期"
              align="center"
              prop="updateCycle"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.updateCycle
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.updateCycle"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label=" 发布日期"
              align="center"
              prop="releaseDate"
              width="228"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.releaseDate
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.releaseDate"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label=" 平台目录标识"
              align="center"
              prop="platformDirectoryId"
              width="120"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.platformDirectoryId
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.platformDirectoryId"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              width="120"
            >
              <template slot-scope="scope">
                <el-button
                  v-show="!scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleEdit(scope.row)"
                  >编辑</el-button
                >
                <el-button
                  v-show="scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleSure(scope.row)"
                  >确定</el-button
                >
                <el-button
                  size="mini"
                  type="text"
                  @click.native.prevent="
                    deleteRow(scope.$index, governmentDataResourcesAddDtoList)
                  "
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 云资源需求 -->
        <div>
          <div class="model-title other-title">
            <img src="@/assets/images/tripartite/icon_title.png" />
            <span>云资源需求</span>
          </div>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button
                type="primary"
                icon="el-icon-plus"
                size="medium"
                @click="handleAddInsertCloud"
                >云资源</el-button
              >
            </el-col>
          </el-row>
          <el-table
            v-loading="loading"
            :data="insertCloudResourceDtoList"
            border
            class="table_technical"
          >
            <el-table-column
              label="云服务器名称"
              align="center"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.cloudServerName
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.cloudServerName"
                  placeholder="请输入"
                  maxlength="30"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column label="CPU(核)" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{ scope.row.cpu }}</span>
                <el-select
                  v-show="scope.row.show"
                  v-model="scope.row.cpu"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in cpuOptions"
                    :key="item.dictValue"
                    :label="item.dictLabel"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="内存(G)" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{ scope.row.memory }}</span>
                <el-select
                  v-show="scope.row.show"
                  v-model="scope.row.memory"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in memoryOptions"
                    :key="item.dictValue"
                    :label="item.dictLabel"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="硬盘" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{ scope.row.hardDisk }}</span>
                <el-select
                  v-show="scope.row.show"
                  v-model="scope.row.hardDisk"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in hardDiskOptions"
                    :key="item.dictValue"
                    :label="item.dictLabel"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="数量" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{ scope.row.number }}</span>
                <el-select
                  v-show="scope.row.show"
                  v-model="scope.row.number"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in numberOptions"
                    :key="item.dictValue"
                    :label="item.dictLabel"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
            >
              <template slot-scope="scope">
                <el-button
                  v-show="!scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleEdit(scope.row)"
                  >编辑</el-button
                >
                <el-button
                  v-show="scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleSure(scope.row)"
                  >确定</el-button
                >
                <el-button
                  size="mini"
                  type="text"
                  @click.native.prevent="
                    deleteRow(scope.$index, insertCloudResourceDtoList)
                  "
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 物联设备信息 -->
        <div>
          <div class="model-title other-title">
            <img src="@/assets/images/tripartite/icon_title.png" />
            <span>物联设备信息</span>
          </div>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button
                type="primary"
                icon="el-icon-plus"
                size="medium"
                @click="handleAddInsertIotDevice"
                >物联设备</el-button
              >
            </el-col>
            <el-col :span="1.5">
              <el-upload
                ref="upload6"
                class="upload-demo"
                :action="upload.url"
                accept=".xls, .xlsx, .doc, .docx, .png, .jpg, .pdf .zip, .rar, .7z"
                :headers="upload.headers"
                :limit="1"
                :on-progress="handleFileUploadSix"
                :on-success="handleFileSix"
              >
                  <el-button type="primary" size="medium">上传附件</el-button>
                </el-upload>
            </el-col>
            <el-col :span="1.5" style="lineHeight:30px">
              <span class="mr10 iotDevice-file" @click="$download(queryParams.iotDeviceFile.fileUrl)">{{queryParams.iotDeviceFile.fileName}}</span>
              <i class="el-icon-error" @click="delIotDeviceFile" v-show="queryParams.iotDeviceFile.fileName"></i>
            </el-col>
          </el-row>
          <el-table
            v-loading="loading"
            :data="insertIotDeviceInfoDtosList"
            border
            class="table_technical"
          >
            <el-table-column
              label="产品名称"
              label-class-name="require"
              align="center"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.productName
                }}</span>
                <el-select
                  v-show="scope.row.show"
                  v-model="scope.row.productName"
                  placeholder="请选择"
                  filterable
                >
                  <el-option
                    v-for="item in productNameOptions"
                    :key="item.dictValue"
                    :label="item.dictLabel"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="参数" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.deviceParam
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.deviceParam"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column label="数量" label-class-name="require" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show" >{{ scope.row.deviceNum }}</span>
                <el-input-number type="number" :min="1" :precision="0" v-show="scope.row.show" v-model="scope.row.deviceNum"></el-input-number>
              </template>
            </el-table-column>
            <el-table-column label="建设地点" label-class-name="require" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.constructionSite
                }}</span>
                <div @click="handSelectMap(scope.row,scope.$index)">
                    <el-input
                    require
                    v-show="scope.row.show"
                    v-model="scope.row.constructionSite"
                    suffix-icon="el-icon-location-outline"
                    placeholder="请点击选择地点"
                  ></el-input>
                </div>
                
              </template>
            </el-table-column>
            <el-table-column label="建设方式" label-class-name="require" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.constructionWay
                }}</span>
                <el-select
                  v-show="scope.row.show"
                  v-model="scope.row.constructionWay"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in wayOptions"
                    :key="item.dictValue"
                    :label="item.dictLabel"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="设备功能" align="center">
              <template slot-scope="scope">
                <span v-show="!scope.row.show">{{
                  scope.row.deviceFunction
                }}</span>
                <el-input
                  v-show="scope.row.show"
                  v-model="scope.row.deviceFunction"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
            >
              <template slot-scope="scope">
                <el-button
                  v-show="!scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleEdit(scope.row)"
                  >编辑</el-button
                >
                <el-button
                  v-show="scope.row.show"
                  size="mini"
                  type="text"
                  @click="handleSure(scope.row, 'iot')"
                  >确定</el-button
                >
                <el-button
                  size="mini"
                  type="text"
                  @click.native.prevent="
                    deleteRow(scope.$index, insertIotDeviceInfoDtosList)
                  "
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
        <el-form-item class="submit-outBox">
          <el-button size="small" class="btn" @click="handBack">取消</el-button>
          <!-- <el-button
            size="small"
            class="btn btn-save"
            type="primary"
            @click="submitForm(1)"
            >保存</el-button
          > -->
          <el-button
            size="small"
            class="btn btn-submit"
            type="primary"
            @click="submitForm()"
            >提交</el-button
          >
        </el-form-item>
      </el-form>
    </el-card>

    <!-- 批量导入弹窗 -->
    <el-dialog :title="uploadImport.title" :visible.sync="uploadImport.open" width="30%" append-to-body custom-class="dialog-box">
      <el-upload
        ref="uploadImport"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="uploadImport.headers"
        :action="uploadImport.url + '?file'"
        :disabled="uploadImport.isUploading"
        :on-progress="handleFileImport"
        :on-success="handleFileSuccessImport"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div class="el-upload__tip" style="color:red" slot="tip">提示：仅允许导入“xls”或“xlsx”格式文件！</div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="uploadImport.open = false">取 消</el-button>
      </div>
    </el-dialog>
<!-- 地图 弹窗 -->
    <MapDialog
      :showMapDialog="showMapDialog"
      @changeShowDialog="changeShowDialog"
      :rowData="rowData"
      :rowIndex="rowIndex"
    ></MapDialog>
    
  </div>
</template>
<script>
import { getToken } from "@/utils/auth";
import {addSchemeDeclaration,updateSchemeDeclaration,getSchemeDeclaration} from "@/api/projectCompany/schemeDeclaration";
import { getMyManagement } from "@/api/projectCompany/myProject";
import { getDeviceName } from "@/api/system/iot";
import MapDialog from "./components/mapDialog";
import CONST from '@/utils/constant';

export default {
  components:{
    MapDialog,
  },
  data() {
    return {
      // 是否显示弹出窗
      showMapDialog: false,
      rowData:{},
      rowIndex:undefined,
      // 遮罩层
      loading: false,
      // 弹出层标题
      title: "",
      // 表单参数
      queryParams: { 
        proId: this.$route.query.proId,
        budgetProposal: {fileName:'',fileUrl:''},
        researchReport: {fileName:'',fileUrl:''},
        preliminaryDesignScheme: {fileName:'',fileUrl:''},
        budgetProgramme: {fileName:'',fileUrl:''},
        cloudResourceApplication: {fileName:'',fileUrl:''},
        iotDeviceFile: {fileName:'',fileUrl:''},
      },        
      // 项目详情数据
      detailData:{},
      // 项目类别判断数据
      projectCategoryData:{},
      // 表单校验
      rules: {
        designUnit: [
          { required: true, message: "请输入设计单位", trigger: "blur" },
        ],
        'budgetProposal.fileName': [
          { required: true, message: "请上传可研批复或立项文件", trigger: ["blur", "change"] },
        ],
        'researchReport.fileName': [
          { required: true, message: "请上传可行性研究报告", trigger: ["blur", "change"] },
        ],
        'preliminaryDesignScheme.fileName': [
          { required: true, message: "请上传初设方案(可研代初设)", trigger: ["blur", "change"] },
        ],
        'budgetProgramme.fileName': [
          { required: true, message: "请上传预算方案", trigger: ["blur", "change"] },
        ],
        // cloudResourceApplication: [
        //   { required: true, message: "请上传云资源需求清单", trigger: ["blur", "change"] },
        // ],
        systemArchitecture: [
          { required: true, message: "请输入系统架构简述", trigger: "blur" },
        ],
        assessmentMethod: [
          { required: true, message: "请选择评标方法", trigger: "change" },
        ],
        otherMethod: [
          { required: true, message: "请输入其他评标方法", trigger: "blur" },
        ],
        projectInvestmentEstimation: [
          { required: true, message: "请输入项目投资估算", tigger: "blur" },
          {
            pattern:
              /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: "请输入正确格式,可保留六位小数",
          },
        ],
      },
      technicalTitleDtoS: [],
      // 系统信息
      systemInfoList: [],
      // 政务数据资源目录清单
      governmentDataResourcesAddDtoList: [],
      // 云资源需求
      insertCloudResourceDtoList: [],
      // 物联设备信息
      insertIotDeviceInfoDtosList: [],
      // cpu数据字典查询
      cpuOptions: [
        { dictValue: "2", dictLabel: "2" },
        { dictValue: "4", dictLabel: "4" },
        { dictValue: "8", dictLabel: "8" },
        { dictValue: "16", dictLabel: "16" },
      ],
      // 内存数据字典查询
      memoryOptions: [
        { dictValue: "4", dictLabel: "4" },
        { dictValue: "8", dictLabel: "8" },
        { dictValue: "16", dictLabel: "16" },
        { dictValue: "3", dictLabel: "32" },
      ],
      // 硬盘数据字典查询
      hardDiskOptions: [
        { dictValue: "128G", dictLabel: "128G" },
        { dictValue: "256G", dictLabel: "256G" },
        { dictValue: "512G", dictLabel: "512G" },
        { dictValue: "1T", dictLabel: "1T" },
        { dictValue: "2T", dictLabel: "2T" },
        { dictValue: "3T", dictLabel: "3T" },
      ],
      // 数量数据字典查询
      numberOptions: [
        { dictValue: "1", dictLabel: "1" },
        { dictValue: "2", dictLabel: "2" },
        { dictValue: "3", dictLabel: "3" },
        { dictValue: "4", dictLabel: "4" },
        { dictValue: "5", dictLabel: "5" },
        { dictValue: "6", dictLabel: "6" },
        { dictValue: "7", dictLabel: "7" },
        { dictValue: "8", dictLabel: "8" },
        { dictValue: "9", dictLabel: "9" },
        { dictValue: "10", dictLabel: "10" },
      ],
      // 建设方式字典查询
      wayOptions: [
        { dictValue: "新建", dictLabel: "新建" },
        { dictValue: "利旧", dictLabel: "利旧" },
      ],
      // 产品名称字典查询
      productNameOptions: [],
      options: [{ dictValue: "0", dictLabel: "CPU利用率均值" }],
      // 上传文件参数
      upload: {
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/file/upload",
        // 上传文件名称
        fileName1: "请选择文件",
        fileName2: "请选择文件",
        fileName3: "请选择文件",
        fileName4: "请选择文件",
        fileName5: "请选择文件",
      },
      // 用户导入参数
      uploadImport: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/system/resources/batchFile"
      },
      // 评标方法数据字典
      assessmentMethodOptions: [
        { dictValue: "综合评分法", dictLabel: "综合评分法" },
        { dictValue: "最低评标价法", dictLabel: "最低评标价法" },
        { dictValue: "性价比法", dictLabel: "性价比法" },
        { dictValue: "其他", dictLabel: "其他" },
      ],
    };
  },
  created() {
    this.getProductNameOptions()
    this.getMyManagementData()
    // this.getDicts("assessment_method").then((res) => {
    //   if(res.code === 200){
    //     this.assessmentMethodOptions = res.data
    //   }
    // });
  },
  methods: {
    // 表单重置
    reset() {
      this.queryParams = {
        designUnit: "",
        systemArchitecture: "",
        proId: this.$route.query.proId,
        budgetProposal: {fileName:'',fileUrl:''},
        researchReport: {fileName:'',fileUrl:''},
        preliminaryDesignScheme: {fileName:'',fileUrl:''},
        budgetProgramme: {fileName:'',fileUrl:''},
        cloudResourceApplication: {fileName:'',fileUrl:''},
        projectInvestmentEstimation:this.projectCategoryData.projectInvestmentEstimation + "",
        assessmentMethod:'',
        otherMethod:'',
        projectCode:'',
        iotDeviceFile: {fileName:'',fileUrl:''}
      };
      this.resetForm("queryParams");
    },
    /** 获取项目详情 */
    getMyManagementData() {
      this.queryParams.proId = this.$route.query.proId;
      getMyManagement(this.queryParams.proId).then((response) => {
        this.detailData = response;
        const relationId = this.$route.query.relationId;
        // 年度申报
        if (this.detailData.AnnualDeclaration && this.detailData.AnnualDeclaration != null) {
          this.projectCategoryData = this.detailData.AnnualDeclaration;
        }
        // 增补申报
        if (
          this.detailData.SupplementaryDeclaration &&
          this.detailData.SupplementaryDeclaration != null
        ) {
          this.projectCategoryData = this.detailData.SupplementaryDeclaration;
        }
        // 方案信息
        if(relationId&&relationId!==undefined&&relationId!=null){     
          getSchemeDeclaration(relationId).then(response=>{
              this.queryParams = response
              this.queryParams.proId = this.$route.query.proId;
              // 当评标方法为其他时进行初始化
              let arr = this.assessmentMethodOptions.filter(item=>item.dictLabel===this.queryParams.assessmentMethod);
              if(arr.length < 1){
                this.$set(this.queryParams, "otherMethod", this.queryParams.assessmentMethod);
                this.queryParams.assessmentMethod = '其他';
              }
              this.$set(this.queryParams, "projectInvestmentEstimation", this.projectCategoryData.projectInvestmentEstimation + "");
              if(response.budgetProposalFile){
                this.queryParams.budgetProposal = response.budgetProposalFile
              }
              if(response.researchReportFile){
                this.queryParams.researchReport = response.researchReportFile
              }
              if(response.preliminaryDesignSchemeFile){
                this.queryParams.preliminaryDesignScheme = response.preliminaryDesignSchemeFile
              }
              if(response.budgetProgrammeFile){
                this.queryParams.budgetProgramme = response.budgetProgrammeFile
              }
              if(response.cloudResourceApplicationFile){
                this.queryParams.cloudResourceApplication = response.cloudResourceApplicationFile
              }
              if(response.iotDeviceFile){
                this.queryParams.iotDeviceFile = response.iotDeviceFile
              }else{
                this.queryParams.iotDeviceFile = {fileName:'',fileUrl:''}
              }
              this.systemInfoList = response.systemInfoList  //系统信息
              this.systemInfoList.map((item) => {
                this.$set(item, "show", false);
              });
              this.governmentDataResourcesAddDtoList = response.governmentDataResourcesAddDtoList //政务清单
              this.governmentDataResourcesAddDtoList.map((item) => {
                this.$set(item, "show", false);
              });
              this.insertCloudResourceDtoList = response.insertCloudResourceDtoList  //云资源需求
              this.insertCloudResourceDtoList.map((item) => {
                this.$set(item, "show", false);
              });
              this.insertIotDeviceInfoDtosList = response.insertIotDeviceInfoDtosList //物联设备
              this.insertIotDeviceInfoDtosList.map((item) => {
                this.$set(item, "show", false);
              });
              console.log(response,'编辑方案');
          })
        }else{
          this.reset()
        }
      });
    },
    /** 返回按钮操作 */
    handBack() {
      this.reset();
      this.$router.push({
        path: "/manage/myProject/myProjectView",
        query: { proId: this.queryParams.proId },
      });
    },
    
    /** 新增按钮操作 政务清单*/
    handleAddGovernment() {
      this.governmentDataResourcesAddDtoList.push({
        classificationOfInformationResourceFormats: "",
        dataLength: 0,
        informationItemName: "",
        informationResourceCode: "",
        informationResourceFormatType: "",
        informationResourceName: "",
        informationResourceProvider: "",
        informationResourceSourceSystem: "",
        isOpen: "",
        openConditions: "",
        other: "",
        platformDirectoryID: "",
        programmeId: 0,
        providersInternalDepartment: "",
        releaseDate: "",
        resourceProviderCode: "",
        shareType: "",
        sharingConditions: "",
        sharingModeClassification: "",
        sharingModeType: "",
        summaryOfInformationResources: "",
        typeOfData: "",
        updateCycle: "",
        show:true,
      });
    },
    /** 新增按钮操作 系统信息*/
    handleAddSystem() {
      this.systemInfoList.push({
        systemName: "",
        systemDesc: "",
        show: true,
      });
    },
    /** 新增按钮操作 云资源*/
    handleAddInsertCloud() {
      this.insertCloudResourceDtoList.push({
        cloudServerName: "",
        cpu: "",
        hardDisk: "",
        memory: "",
        number: undefined,
        show: true,
      });
    },
    /** 新增按钮操作 	物联设备*/
    handleAddInsertIotDevice() {
      this.insertIotDeviceInfoDtosList.push({
        constructionSite: "",
        constructionWay: "",
        deviceFunction: "",
        deviceNum: 1,
        deviceParam: "",
        productName: "",
        show: true,
      });
    },
    handleSure(row, type) {
      if (type === 'iot') {
        let reflect = {
          constructionSite: '建设地点',
          productName: '产品名称',
          constructionWay: '建设方式',
          deviceNum: '数量'
        };
        let msg = [ 'productName','deviceNum','constructionSite','constructionWay'].filter(key => row[key] === '' || row[key] === 0).map(key => {
          return reflect[key]
        }).join(',')
        if (msg) {
          return this.$message.error(`${msg}未填写完整或填写错误`)
        }
      }
      if (row.show == true) {
        row.show = false;
      }
    },
    /** 修改按钮操作 新增系统信息*/
    handleEdit(row) {
      if (row.show == false) {
        row.show = true;
      }
    },
    deleteRow(index, rows) {
      rows.splice(index, 1);
    },
    // 提交按钮（表单）
    submitForm() {
      console.log("方案申报保存", this.queryParams);
      this.$refs["queryParams"].validate((valid) => {
        if (valid) {
          this.queryParams.proId = this.$route.query.proId;
          this.queryParams.systemInfoList = this.systemInfoList.filter((item) => item.show == false)
          this.queryParams.governmentDataResourcesAddDtoList = this.governmentDataResourcesAddDtoList.filter((item) => item.show == false)
          this.queryParams.insertCloudResourceDtoList = this.insertCloudResourceDtoList.filter((item) => item.show == false)
          this.queryParams.insertIotDeviceInfoDtosList = this.insertIotDeviceInfoDtosList.filter((item) => item.show == false)
          // 对评标方法为其他时赋值
          if(this.queryParams.assessmentMethod === '其他'){
            this.queryParams.assessmentMethod = this.queryParams.otherMethod;
          }
          const relationId = this.$route.query.relationId;
          if (relationId == undefined || relationId == "") {
            addSchemeDeclaration(this.queryParams).then((response) => {
              // console.log("新增方案申报提交", this.queryParams);
              this.msgSuccess("提交成功");
              this.$router.push({
                path: "/manage/myProject/myProjectView",
                query: { proId: this.queryParams.proId },
              });
            });
          } else {
            updateSchemeDeclaration(this.queryParams).then((response) => {
              this.msgSuccess("修改成功");
              this.$router.push({
                path: "/manage/myProject/myProjectView",
                query: { proId: this.queryParams.proId },
              });
            });
          }
        }
      });
    },

    // 文件上传中处理 可研批复或立项文件
    handleFileUploadProgressOne(event, file, fileList) {
      console.log("文件上传中", file);
    },
    // 文件上传成功处理
    handleFileSuccessOne(response, file, fileList) {
      console.log("文件上传成功", response, file);
      this.$refs.upload1.clearFiles();
      if(response.code!=500&&response.data){
        this.upload.fileName1 = file.name;
        const budgetProposal = new Object();
        budgetProposal.fileName = file.name;
        budgetProposal.fileUrl = response.data.fileUrl;
        this.queryParams.budgetProposal = budgetProposal;
      }else{
        this.$message.error(response.msg)
      }
    },
    // 文件上传中处理 可行性研究报告
    handleFileUploadTwo(event, file, fileList) {
      console.log("文件上传中", file);
    },
    // 文件上传成功处理
    handleFileTwo(response, file, fileList) {
      console.log("文件上传成功", response, file);
      this.$refs.upload2.clearFiles();
      if(response.code!=500&&response.data){
        this.upload.fileName2 = file.name;
        const researchReport = new Object();
        researchReport.fileName = file.name;
        researchReport.fileUrl = response.data.fileUrl;
        this.queryParams.researchReport = researchReport;
      }else{
        this.$message.error(response.msg)
      }
    },
    // 文件上传中处理 初设方案(可研代初设)
    handleFileUploadThree(event, file, fileList) {
      console.log("文件上传中", file);
    },
    // 文件上传成功处理
    handleFileThree(response, file, fileList) {
      console.log("文件上传成功", response, file);
      this.$refs.upload3.clearFiles();
      if(response.code!=500&&response.data){
        this.upload.fileName3 = file.name;
        const preliminaryDesignScheme = new Object();
        preliminaryDesignScheme.fileName = file.name;
        preliminaryDesignScheme.fileUrl = response.data.fileUrl;
        this.queryParams.preliminaryDesignScheme = preliminaryDesignScheme; 
      }else{
        this.$message.error(response.msg)
      }
    },
    // 文件上传中处理 预算方案
    handleFileUploadFour(event, file, fileList) {
      console.log("文件上传中", file);
    },
    // 文件上传成功处理
    handleFileFour(response, file, fileList) {
      console.log("文件上传成功", response, file);
      this.$refs.upload4.clearFiles();
      if(response.code!=500&&response.data){
        this.upload.fileName4 = file.name;
        const budgetProgramme = new Object();
        budgetProgramme.fileName = file.name;
        budgetProgramme.fileUrl = response.data.fileUrl;
        this.queryParams.budgetProgramme = budgetProgramme;
      }else{
        this.$message.error(response.msg)
      }
      
    },
    // 文件上传中处理 云资源需求清单
    handleFileUploadFive(event, file, fileList) {
      console.log("文件上传中", file);
    },
    // 文件上传成功处理
    handleFileFive(response, file, fileList) {
      console.log("文件上传成功", response, file);
      this.$refs.upload5.clearFiles();
      if(response.code!=500&&response.data){
        this.upload.fileName5 = file.name;     
        const cloudResourceApplication = new Object();
        cloudResourceApplication.fileName = file.name;
        cloudResourceApplication.fileUrl = response.data.fileUrl;
        this.queryParams.cloudResourceApplication = cloudResourceApplication;
      }else{
        this.$message.error(response.msg)
      }
    },
    // 文件上传中处理 物联设备
    handleFileUploadSix(event, file, fileList) {
      console.log("文件上传中", file);
    },
    // 文件上传成功处理
    handleFileSix(response, file, fileList) {
      console.log("文件上传成功", response, file);
      this.$refs.upload6.clearFiles();
      if(response.code!=500&&response.data){     
        const iotDeviceFile = new Object();
        iotDeviceFile.fileName = file.name;
        iotDeviceFile.fileUrl = response.data.fileUrl;
        this.queryParams.iotDeviceFile = iotDeviceFile;
      }else{
        this.$message.error(response.msg)
      }
    },
    delIotDeviceFile(){
      this.queryParams.iotDeviceFile = {fileName:'',fileUrl:''}
    },
    /** 导入按钮操作 政务清单*/
    handleAddImport() {
      this.uploadImport.title = "导入政务清单";
      this.uploadImport.open = true;
    },   
    // 文件上传中处理
    handleFileImport(event, file, fileList) {
      this.uploadImport.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccessImport(response, file, fileList) {
      this.uploadImport.open = false;
      this.uploadImport.isUploading = false;
      this.$refs.uploadImport.clearFiles();
      console.log('导入政务清单成功',response,file);
      if(response.code==200&&response.data){
        this.governmentDataResourcesAddDtoList = response.data.governmentDataResourcesList
        this.governmentDataResourcesAddDtoList.map((item) => {
          this.$set(item, "show", false);
        });
      }
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.uploadImport.submit();
    },

    // 选择地点按钮操作
    handSelectMap(row,index){
      this.rowData = row
      this.rowIndex = index
      this.showMapDialog = true;
    },
    changeShowDialog(data) {
      if (data == "false") {
        
        this.showMapDialog = false;
      } else {
        this.showMapDialog = true;  
      }
    },
    getProductNameOptions() {
      getDeviceName().then(res => {
        if (res.code !== 200) return ;
        this.productNameOptions = [ '其他', ...res.data ].map(dictLabel => ({dictLabel, dictValue: dictLabel}))
      })
    },
    /** 下载清单模版 */
    downloadFile() {
        window.location.href = `${CONST.TPL_DOWNLOAD}/yzq-approve/附件2.渝中区政务数据资源目录清单模板V1.2.xlsx`;
    },
  },
};
</script>
<style scoped lang="scss">
.expert-title-outBox {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  .expert-title {
    font-weight: 500;
    font-size: 18px;
  }
  .back-btn {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    img {
      width: 16px;
      height: 16px;
      margin-right: 6px;
      position: relative;
      top: 2px;
    }
  }
}
.submit-outBox {
  margin-left: 0;
  padding-top: 48px;
  width: 100%;
  text-align: center;
  border-top: 1px solid #ebecef;
  .btn {
    width: 196px;
    height: 40px;
    margin-right: 10px;
  }
  .btn-submit {
    background: #0d72ff;
  }
  .btn-save {
    border: 1px solid #3171ee;
    color: #3171ee;
    background: #fff;
  }
}
.model-title {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #ebecef;
  border-top: 1px solid #ebecef;
  margin-bottom: 24px;
  img {
    width: 16px;
    height: 16px;
    position: relative;
    right: 5px;
    top: 2px;
  }
  span{
    font-size: 14px;
    font-weight: 600;
  }
}
.other-title {
  margin-top: 24px;
}
.table_technical,
.table_profession {
  margin-top: 24px;
}
.unit {
  width: 52px;
  height: 36px;
  text-align: center;
  line-height: 36px;
  color: #666;
  background: #f6f6f6;
  border-radius: 0px 4px 4px 0px;
  border: 1px solid #d8d8d8;
  position: absolute;
  left: 88%;
  top: 0px;
}
.iotDevice-file{
  cursor: pointer;
  color: #3171ee;
}
</style>
<style lang="scss">
/**表单label取消加粗 */
.card-form {
  label {
    font-weight: normal !important;
  }
}
.submit-outBox {
  .el-form-item__content {
    margin-left: 0 !important;
  }
}
/* 弹出窗样式 */
.dialog-box {
  .el-dialog__body {
    padding: 24px 69px 24px 69px;
    border-top: 1px solid #ebecef;
    border-bottom: 1px solid #ebecef;
    label {
      font-weight: 400 !important;
    }
  }
  .el-dialog__footer {
    padding: 16px 20px;
  }
  .el-dialog__headerbtn {
    background: url("../../../assets/images/icon_dialog_close.png");
    background-size: 100%;
    width: 16px;
    height: 16px;
    .el-dialog__close {
      visibility: hidden;
    }
  }
}
/* 删除弹出框样式 */
.del_box {
  width: 345px;
  height: 175px;
  .el-message-box__headerbtn {
    background: url("../../../assets/images/icon_dialog_close.png");
    background-size: 100%;
    width: 16px;
    height: 16px;
    .el-message-box__close {
      visibility: hidden;
    }
  }
  .el-message-box__content {
    padding: 26px 95px;
    font-size: 16px;
    .el-message-box__status.el-icon-warning {
      color: #ea4747;
    }
    .el-message-box__status + .el-message-box__message {
      padding-right: 0;
    }
  }
}
// 文本域样式修改
.form-textarea {
  .el-form-item__content{
    margin-left: 0 !important;
  }
}
// 文件上传
.upload-demo {
  .el-upload-list {
    display: none;
  }
  .el-upload {
    display: flex;
  }
  .img_box {
    height: 36px;
    width: 36px;
    line-height: 36px;
    background: #0d72ff;
    text-align: center;
    border-radius: 0px 4px 4px 0px;
    position: absolute;
    right: -1%;
    top: 1px;
    img {
      width: 16px;
      height: 16px;
    }
  }
}
.require.cell{
  &:before{
    display: inline-block;
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: red;
    vertical-align: middle;
    margin-right: 5px;
  }
}
</style>
